#!/bin/bash

# Upgrade packages and reboot the system if required.
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade --yes
apt-get autoremove --yes

if [ -f /var/run/reboot-required ]; then
    /sbin/reboot
fi
